<?php
ImportClass('rss');

$myfeed = new RSSFeed();
$urlNews      = getUrlCatByType('news');
$title        = getLang('News') .' '. getConfig('TitleSite');
$description  = '';
$myfeed->SetChannel(echoLink($urlNews,false,2),$title,$description,$root_domain);

$sql_select   = "select * from tblnews_content where iStatus =1 ";
if(!empty($act))
{
    $idP      = getIdCatByType('news',$act);
    $sql_select.= " and iParentId = $idP";
}
$sql_select   .= " and cLanguage = '$language' order by iId desc limit 10";
$rs           = $dbsql->query($sql_select);
while($result   = $dbsql->fetch_array($rs))
{
    $url        = getLinkParentCat($result['iParentId']).'/'.$result['cUrlString'].'.htm';
    $description= $result['cDescription'];
    $imglink    = GetIntroImg($result['cImage'],true,false);
    if($imglink)
    {
        $description    = '<a href='.echoLink($url,false,2).'><img src="'.$root_domain.$imglink.'"></a>'.$description;
    }
    $myfeed->SetItem(echoLink($url,false,2),$result['cName'],$description,$result['dPostDate']);
}

$myfeed->output(true);
?>